<template>
	<view class="warp">
		<view class="list">
			<view class="item" v-for="(item,index) in list" :key="index">
				<view class="idx">
					{{index+1}}
				</view>
				<view class="name">
					<span class="title">转发内容：</span>
					<span>{{item.videoForwardName}}</span>
				</view>
				<view class="time">
					<span class="title">转发时间:</span>
					<span>{{item.forwardTime}}</span>
				</view>
				<view class="bottom" @click="toatend(item)">
					点击查看报名数据
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { mapState, mapMutations } from 'vuex'
	export default {
		data() {
			return {
				queryform:{
					pageSize:20,
					current:1,
				},
				total:0,
				list:[]
			};
		},
		onLoad() {
			this.getlist()
		},
		computed: {
		  ...mapState(['hasLogin', 'userInfo', 'userCenterData'])
		},
		// 下拉
			onPullDownRefresh() {
				// 刷新位置
			this.getlist()
				var that=this
				setTimeout(function(){
						uni.stopPullDownRefresh()
					},1000)
			},
			onReachBottom(){
				if(this.queryform.pageSize*this.queryform.current>this.total){
					uni.showToast({
						title:"数据加载完毕",
						icon:'none'
					})
				}else{
					this.queryform.current++
					this.$request({
						url:'v3/customer/front/videoForwardRecord/page',
						method:'GET',
						data:this.queryform
					}).then(res=>{
						this.list.push(...res.data.list)
						
					})
				}
			},
		methods:{
			
			getlist(){
				this.queryform.forwardPeopleId=this.userCenterData.memberId
				this.$request({
					url:'v3/customer/front/videoForwardRecord/page',
					methods:'GET',
					data:this.queryform
				}).then(res=>{
					if(res.state==200){
						this.list=res.data.list
						this.total=res.data.pagination.total
					}
				})
			},
			toatend(val){
				uni.navigateTo({
					url:"/extra/atendvideolist/atendvideolist?id="+val.videoForwardId
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
page{
		width: 750rpx;
		margin: 0 auto;
		background: #F5F5F5;
	}
	.warp{
		color: #282828;
		.list{
			padding: 10rpx 20rpx;
			.item{
				
				border-radius: 10rpx;
				padding: 20rpx 20rpx;
				background-color: #fff;
				margin-top: 10rpx;
				.idx{
					color: #cecece;
				}
				.name{
					margin-top: 15rpx;
					font-size: 30rpx;
					color: #ff841f;
					.title{
						color: #282828;
						margin-right: 20rpx;
					}
				}
				.time{
					margin-top: 15rpx;
					color: #cecece;
					.title{
						color: #282828;
						margin-right: 20rpx;
					}
				}
				.bottom{
					margin-top: 15rpx;
					padding: 15rpx;
					border-top: 2rpx solid #cecece;
					color: #ff841f;
				}
			}
		}
	}
</style>
